import request from '@/utils/http/axios';

class RoleApi {
    static getUserRole(userId){
        return request({
            url: "/role/userRole",
            params: {userId},
            method: "get"
        })
    }

    static getRoleList(){
        return request({
            url: "/role/roleList",
            method: "get"
        })
    }

    // role: {id, name, code, menuIds}
    static addOrUpdateRole(role){
        return request({
            url: "/role/addOrUpdate",
            data: role,
            method: "post"
        })
    }

    static deleteRole(roleId){
        return request({
            url: "/role/delete",
            params: {roleId},
            method: "delete"
        })
    }

}

export default RoleApi;